home *** CD-ROM | disk | FTP | other *** search
- Path: hickory.soton.ac.uk!newsmaster
- From: jcridge <jcridge@mail.soton.ac.uk>
- Newsgroups: comp.lang.c++
- Subject: Borland C++ v4.02: TIArrayAsVector container class within another class
- Date: 5 Jan 1996 16:23:57 GMT
- Organization: Computing Services, University of Southampton
- Message-ID: <4cjjat$bqj@hickory.soton.ac.uk>
- NNTP-Posting-Host: jcridge.maths.soton.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
-
- Could anyone confirm that the following (below) is the correct way to create a new class which
- contains a TIArrayAsVector container class as one of its data members?
-
- The only example that I could find in the manuals was tucked away in the
- BC4:\examples\classlib\testdir subdirectory. The example in the programmers guide made things
- more complicated by involving a template class structure aswell which doesn't help; the
- programmers guide also mislabelled the \testdir directory as \directry (pp229), but it would
- appear that the syntax below is correct if a little awkward and non-intuitive.
-
- The simple example below appears to compile, but my program is crashing for some reason when I
- try to use getch() later on...
-
-
- //////////////////////////////////////////////////////////////////////////////////////////////
-
- //header file....
-
- class anotherclass
- {public:
- anotherclass();
- int a;
- }
-
- class myclass
- {public:
- myclass();
- TIArrayAsVector<anotherclass> arrayname;
- };
-
-
- //cpp file
-
- tsectorbase::tsectorbase():arrayname(1,1,1)
- {...}
-
- anotherclass::anotherclass()
- {a=0;}
-
- ///////////////////////////////////////////////////////////////////////////////////////////
-
-